package com.younge.spring.repository;

import com.younge.spring.repository.dao.Demo;
import com.younge.spring.repository.dao.SysUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.ListPagingAndSortingRepository;

import java.util.Optional;

public interface SysUserRepository extends ListPagingAndSortingRepository<SysUser, Integer>,
        JpaSpecificationExecutor<SysUser> {

    Optional<SysUser> findByUsername(String username);

    Optional<SysUser> findByUsernameAndPassword(String username, String password);
}